<?php
defined('BASEPATH') OR exit('No direct script access allowed');


use QCloud_WeApp_SDK\Mysql\Mysql as DB;



class ShopCartList extends CI_Controller {
    public function index() {
//        $id = $_GET['id'];
//        $gtype_id = $_GET['gtype_id'];
//        $goods_id = $_GET['goods_id'];
//        $goods_name = $_GET['goods_name'];
//        $goods_att = $_GET['goods_att'];
//        $num = $_GET['num'];
//        $amount = $_GET['amount'];

        $zf = $_GET['zt'];
        $rows = null;
        if(1==$zf){
            $rows = DB::select('cc_order');
            $rows = DB::select('cc_order', ['*'], ['zt' => $zf]);
        }else if(2==$zf){
            $rows = DB::select('cc_order');
            $rows = DB::select('cc_order', ['*'], ['zt' => '9']);
        }else if(3==$zf){
            $rows = DB::select('cc_order');
            $rows = DB::select('cc_order', ['*'], ['zt' => '3']);
        }else if(4==$zf){
            $rows = DB::select('cc_order');
            $rows = DB::select('cc_order', ['*'], ['zt' => '4']);
        }else{
            $rows = DB::select('cc_order');
        }

        if (!empty($rows)){
            $this->json([
                'code' => 0,
                'data' => $rows
            ]);
        } else {
            $this->json([
                'code' => -1,
                'error' => $rows['error']
            ]);
        }
    }
}
